﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Common
{
    [ActiveRecord("FIRMS")]
    [Serializable]
    public class Firm : PersistentObjectWithGuid
    {
        #region 公司账号
        [Property("FIRM_CODE")]
        //[ValidateIsUnique("数据库已经存在相同的公司账号！")]
        [ValidateNonEmpty, ValidateLength(0, 100, "公司账号超长！")]
        public virtual string FirmCode
        {
            get
            {
                return firmCode;
            }
            set
            {
                firmCode = value;
            }
        }
        private string firmCode;
        #endregion

        #region 公司名称
        [Property("FIRM_NAME")]
        [ValidateLength(0, 100, "公司名称超长！")]
        public virtual string FirmName
        {
            get
            {
                return firmName;
            }
            set
            {
                firmName = value;
            }
        }
        private string firmName;
        #endregion

        #region 所属行业
        [Property("FIRM_TRADE")]
        [ValidateLength(0, 100, "所属行业超长！")]
        public virtual string FirmTrade
        {
            get
            {
                return firmTrade;
            }
            set
            {
                firmTrade = value;
            }
        }
        private string firmTrade;
        #endregion

        #region 公司英文名字
        [Property("FIRM_NAME_ENGLISH")]
        [ValidateLength(0, 100, "公司英文名字超长！")]
        public virtual string FirmEngLishName
        {
            get
            {
                return firmEngLishName;
            }
            set
            {
                firmEngLishName = value;
            }
        }
        private string firmEngLishName;
        #endregion

        #region 联系人
        [Property("LINKMAN")]
        [ValidateLength(0, 20, "联系人超长！")]
        public virtual string Contact
        {
            get
            {
                return contact;
            }
            set
            {
                contact = value;
            }
        }
        private string contact;
        #endregion

        #region 公司网站
        [Property("FIRM_URL")]
        [ValidateLength(0, 100, "公司网站超长！")]
        public virtual string FirmWebsite
        {
            get
            {
                return firmWebsite;
            }
            set
            {
                firmWebsite = value;
            }
        }
        private string firmWebsite;
        #endregion

        #region 手机
        [Property("CELLPHONE")]
        [ValidateLength(0, 15, "手机号码超长！")]
        public virtual string CellPhone
        {
            get
            {
                return cellPhone;
            }
            set
            {
                cellPhone = value;
            }
        }
        private string cellPhone;
        #endregion

        #region 电话号码
        [Property("PHONE_NUMBER")]
        [ValidateLength(0, 15, "电话号码超长！")]
        public virtual string PhoneNumber
        {
            get
            {
                return phoneNumber;
            }
            set
            {
                phoneNumber = value;
            }
        }
        private string phoneNumber;
        #endregion

        #region 传真号码
        [Property("FAX_NUMBER")]
        [ValidateLength(0, 15, "传真号码超长！")]
        public virtual string FaxNo
        {
            get
            {
                return faxNo;
            }
            set
            {
                faxNo = value;
            }
        }
        private string faxNo;
        #endregion

        #region Email
        private string email = string.Empty;
        [Property("EMAIL")]
        [ValidateLength(0, 40, "Email超长！")]
        public virtual String Email
        { get { return email; } set { email = value; } }
        #endregion

        #region 通信地址
        private string chineseAddress;
        [Property("COMMUNICATE_ADDRESS")]
        [ValidateLength(0, 100, "通信地址超长！")]
        public virtual String ChineseAddress
        { get { return chineseAddress; } set { chineseAddress = value; } }
        #endregion

        #region 通信地址（英文）
        private string englishAddress;
        [Property("COMMUNICATE_ADDRESS_ENGLISH")]
        [ValidateLength(0, 100, "通信地址（英文）超长！")]
        public virtual String EnglishAddress
        { get { return englishAddress; } set { englishAddress = value; } }
        #endregion

        #region 送货地址1
        private string productAddress1;
        [Property("DELIVER_GOODS_ADDRESS1")]
        [ValidateLength(0, 100, "送货地址1超长！")]
        public virtual String ProductAddress1
        { get { return productAddress1; } set { productAddress1 = value; } }
        #endregion

        #region 送货地址2
        private string productAddress2;
        [Property("DELIVER_GOODS_ADDRESS2")]
        [ValidateLength(0, 100, "送货地址1超长！")]
        public virtual String ProductAddress2
        { get { return productAddress2; } set { productAddress2 = value; } }
        #endregion

        #region 送货地址3
        private String productAddress3 = String.Empty;
        [Property("DELIVER_GOODS_ADDRESS3")]
        [ValidateLength(0, 100, "送货地址1超长！")]
        public virtual String ProductAddress3
        { get { return productAddress3; } set { productAddress3 = value; } }
        #endregion

        #region 纳税识别号
        private String taxNo;
        [Property("RATEPAYING_IDENTIFY")]
        [ValidateLength(0, 20, "纳税识别号超长！")]
        public virtual String TaxNo
        { get { return taxNo; } set { taxNo =value;} }
        #endregion

        #region 开户银行
        private String bank;
        [Property("BANK")]
        [ValidateLength(0, 100, "开户银行超长！")]
        public virtual String Bank
        { get { return bank; } set { bank=value; } }
        #endregion

        #region 开户账号
        private String bankAccout;
        [Property("ACCOUNT")]
        [ValidateLength(0, 100, "开户账号超长！")]
        public virtual String BankAccout
        { get { return bankAccout; } set { bankAccout = value; } }
        #endregion

        #region 公司Logo
        private String firmLogo;
        [Property("FIRM_LOGO")]
        [ValidateLength(0, 100, "公司Logo超长！")]
        public virtual String FirmLogo
        { get { return firmLogo; } set { firmLogo = value; } }
        #endregion

        #region 公司Logo内容
        private byte[] logContent;
        [Property("FIRM_LOGO_CONTENT")]
        public virtual byte[] LogContent
        {
            get
            {
               return logContent;
            }
            set
            {
                logContent=value;
            }
        }
        #endregion
    }
}
;